From: emellor@ewan Date: Sat, 17 Sep 2005 09:49:14 +0000 (+0100) Subject: Added diagnostic message to exception when TypeError occurs on write. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16780^2~47^2~18 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=b7411027d63a8b879d3e51a65dd0b9452f84b4d1;p=xen.git Added diagnostic message to exception when TypeError occurs on write. --- diff --git a/tools/python/xen/xend/xenstore/xstransact.py b/tools/python/xen/xend/xenstore/xstransact.py index 62dfc49627..3c56251659 100644 --- a/tools/python/xen/xend/xenstore/xstransact.py +++ b/tools/python/xen/xend/xenstore/xstransact.py @@ -67,7 +67,12 @@ class xstransact: if not isinstance(d, dict): raise TypeError for key in d.keys(): - self._write(key, d[key], create, excl) + try: + self._write(key, d[key], create, excl) + except TypeError, msg: + raise TypeError('Writing %s: %s: %s' % + (key, str(d[key]), msg)) + elif isinstance(args[0], list): for l in args: if not len(l) == 2: